Skip to content

feat: add script to generate preview gifs and add them to the README #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cmgriffing
Copy link
Contributor

This script generates gifs of each shader in the repo and then shows those gifs in the README.

I think the GIFs could be higher resolution, but then the file size can be a bit much. I experimented a bit with videos but it seems GitHub doesn't allow embedding video into the README.

@@ -0,0 +1,94 @@
#!/bin/bash

CONFIG_FILE="$HOME/Library/Application Support/com.mitchellh.ghostty/config"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CONFIG_FILE can also live in $XDG_CONFIG/ghostty and $HOME/.config/ghostty so we should check to see where the ghostty config exists before continuing.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could probably do something along the lines of checking where the file exists first and then setting CONFIG_FILE to the matched path.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$XDG_CONFIG/ghostty

Isn't that supposed to be $XDG_CONFIG_HOME/ghostty?

if ! command -v ffmpeg &> /dev/null; then
echo "ffmpeg is required but not installed. Please install it with 'brew install ffmpeg'"
exit 1
fi
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also have a check to make sure one of the files exist and if it doesn't, instead of moving config to config.backup, we'd simply create a config and then delete it following the process. (this way users who have a no-config setup for ghostty don't have a ton of errors popping up)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or use open -na Ghostty.app --args --config-default-files=false --custom-shader=/some/path.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the fact that it shows your code for a second probably isn't intended haha - feel free to update it

Copy link

@RlxChap2 RlxChap2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect but you can add something special to be more interactive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants